package org.hismig.utils;

import java.io.File;

/**
 * @declare: //TODO <br />
 *           This class created by Vansion.Hopihit on 2012-8-15 <br />
 *           <a href="mailto:vansionhopihit@gmail.com">Contact Me</a>
 * @version 1.0
 * @author Vansion.Hopihit
 * 
 */
public class FileTool {

	private static final String RUNTIME_PATH = System.getProperty("user.dir")
			+ File.separator;

	public static File getRuntimeFile(String fileName) {
		CheckTool.checkNotEmpty(fileName);

		File file = new File(RUNTIME_PATH + fileName);

		return file;
	}

	public static File getRuntimeFile(String fileName, String path) {

		CheckTool.checkNotEmpty(path);
		CheckTool.checkNotEmpty(fileName);

		File filePath = new File(RUNTIME_PATH + path);

		if (!filePath.exists()) {
			filePath.mkdirs();
		}

		return getRuntimeFile(path + File.separator + fileName);

	}

}
